﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using KPIS.GERP.GIMS.MODEL;
using KPIS.GERP.GIMS.DAL;

namespace KPIS.GERP.GIMS.BLL
{
    public class AssetBLL
    {
        private static readonly AssetDAL dal = new AssetDAL();

        public IList<AssetInfo> GetAsset(Nullable<int> Sequence, string SearchText)
        {
            return dal.GetAsset(Sequence, SearchText);
        }
        public AssetInfo GenerateAssetCode(string AssetCode)
        {
            return dal.GenerateAssetCode(AssetCode);
        }
        public AssetInfo GenerateRunningNumber(string SubAssetCode)
        {
            return dal.GenerateRunningNumber(SubAssetCode);
        }
        public void Insert(AssetInfo info)
        {
            try
            {
                dal.Insert(info);
            }
            catch
            {
                throw;
            }
        }
        public void Update(AssetInfo info)
        {
            try
            {
                dal.Update(info);
            }
            catch
            {
                throw;
            }
        }
        public void UpdateIcmReceive(M_IcmReceiveObject info)
        {
            try
            {
                dal.UpdateIcmReceive(info);
            }
            catch
            {
                throw;
            }
        }
        public void Delete(string AssetCodeStart, string AssetCodeEnd, string Remark, int UpdatedBy)
        {
            try
            {
                dal.Delete(AssetCodeStart, AssetCodeEnd, Remark);
            }
            catch
            {
                throw;
            }
        }
    }
}
